home *** CD-ROM | disk | FTP | other *** search
/ IRIS Performer 2.2 Friends Demo / SGI IRIS Performer 2.2 Friends Demo.iso / friends / openworlds / tix / FileDlg.tcl < prev    next >
Text File  |  1997-11-22  |  2KB  |  59 lines

  1. tixWidgetClass tixFileSelectDialog {
  2.     -classname TixFileSelectDialog
  3.     -superclass tixStdDialogShell
  4.     -method {
  5.     }
  6.     -flag {
  7.     -command
  8.     }
  9.     -configspec {
  10.     {-command command Command {}}
  11.  
  12.     {-title title Title "Select A File"}
  13.     }
  14. }
  15.  
  16. proc tixFileSelectDialog::ConstructTopFrame {w frame} {
  17.     upvar #0 $w data
  18.  
  19.     tixChainMethod $w ConstructTopFrame $frame
  20.  
  21.     set data(w:fsbox) [tixFileSelectBox $frame.fsbox \
  22.     -command "tixFileSelectDialog::Invoke $w"]
  23.     pack $data(w:fsbox) -expand yes -fill both
  24. }
  25.  
  26. proc tixFileSelectDialog::SetBindings {w} {
  27.     upvar #0 $w data
  28.  
  29.     tixChainMethod $w SetBindings
  30.  
  31.     $data(w:btns) subwidget ok     config -command "$data(w:fsbox) invoke" \
  32.     -underline 0
  33.     $data(w:btns) subwidget apply  config -command "$data(w:fsbox) filter" \
  34.     -text Filter -underline 0
  35.     $data(w:btns) subwidget cancel config -command "wm withdraw $w" \
  36.     -underline 0
  37.     $data(w:btns) subwidget help config -underline 0
  38.  
  39.  
  40.     bind $w <Alt-Key-l> "focus [$data(w:fsbox) subwidget filelist]"
  41.     bind $w <Alt-Key-d> "focus [$data(w:fsbox) subwidget dirlist]"
  42.     bind $w <Alt-Key-s> "focus [$data(w:fsbox) subwidget selection]"
  43.     bind $w <Alt-Key-t> "focus [$data(w:fsbox) subwidget filter]"
  44.     bind $w <Alt-Key-o> "tkButtonInvoke [$data(w:btns) subwidget ok]"
  45.     bind $w <Alt-Key-f> "tkButtonInvoke [$data(w:btns) subwidget apply]"
  46.     bind $w <Alt-Key-c> "tkButtonInvoke [$data(w:btns) subwidget cancel]"
  47.     bind $w <Alt-Key-h> "tkButtonInvoke [$data(w:btns) subwidget help]"
  48. }
  49.  
  50. proc tixFileSelectDialog::Invoke {w filename} {
  51.     upvar #0 $w data
  52.  
  53.     wm withdraw $w
  54.  
  55.     if {$data(-command) != {}} {
  56.     eval $data(-command) [list $filename]
  57.     }
  58. }
  59.